package com.pass.seven;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

/**
 * Emits 
 * 		(lower left corner key -> 1)
 *  
 * @author bh349
 *
 */
public class PassSevenMapper extends
		Mapper<LongWritable, Text, Text, IntWritable> {
	@Override
	public void map(LongWritable key, Text value, Context context)
			throws IOException, InterruptedException {
		String[] keyVal = value.toString().split("\\t");
		String[] vals = keyVal[1].split(" ");
		context.write(new Text(vals[0] + " " + vals[1]), new IntWritable(1));
	}
}